home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!uunet!elroy.jpl.nasa.gov!lll-winken!sun-barr!newstop!exodus!NMSU.Edu!mleisher
- From: mleisher@NMSU.Edu
- Newsgroups: comp.sources.x
- Subject: v13i040: kterm - kanji xterm, Patch1, Part01/01
- Message-ID: <14025@exodus.Eng.Sun.COM>
- Date: 25 May 91 22:02:46 GMT
- References: <csx-13i040:kterm@uunet.UU.NET>
- Sender: news@exodus.Eng.Sun.COM
- Lines: 418
- Approved: argv@sun.com
-
- Submitted-by: mleisher@NMSU.Edu
- Posting-number: Volume 13, Issue 40
- Archive-name: kterm/patch1
- Patch-To: kterm: Volume XXX, Issue XXX
-
- Submitted-By: mleisher@nmsu.edu
- Patch-To: kterm - kanji xterm: Volume 12, Issue 82-99
-
- Because of the potentially annoying side-effects of tab and newline
- preservation, I've added a command line switch and a VT menu option to
- turn the preservation on or off.
-
- This brings kterm 4.1.2 to patchlevel 7.
-
- [ Moderator's Note: this is the *first* patch since the original submission! ]
-
- *** KTerm.ad.ORIG Mon May 13 19:42:13 1991
- --- KTerm.ad Mon May 13 20:19:08 1991
- ***************
- *** 35,40 ****
- --- 35,41 ----
- *vtMenu*cursesemul*Label: Enable Curses Emulation
- *vtMenu*visualbell*Label: Enable Visual Bell
- *vtMenu*marginbell*Label: Enable Margin Bell
- + *vtMenu*tabnlpres*Label: Enable TAB/NL Preservation
- *vtMenu*altscreen*Label: Show Alternate Screen
- *vtMenu*softreset*Label: Do Soft Reset
- *vtMenu*hardreset*Label: Do Full Reset
- *** button.c.ORIG Mon May 13 19:41:55 1991
- --- button.c Mon May 13 21:35:08 1991
- ***************
- *** 1594,1606 ****
- else {
- lp = SaveText(screen, crow, ccol, screen->max_col, lp);
-
- ! for(i = crow +1; i < row; i++)
- ! /*
- ! * If any real EOL's occur in the text, SaveText takes care
- ! * of inserting them into the saved line.
- ! * TAB's are also preserved in SaveText.
- ! */
- ! lp = SaveText(screen, i, 0, screen->max_col, lp);
-
- if (col >= 0)
- lp = SaveText(screen, row, 0, col, lp);
- --- 1594,1628 ----
- else {
- lp = SaveText(screen, crow, ccol, screen->max_col, lp);
-
- ! /*
- ! * Only preserve tabs and newlines if the flag is set, otherwise
- ! * act in the normal fashion.
- ! */
- ! if (screen->tabnlpres != True) {
- ! #ifdef KTERM
- ! lp->code = '\n'; /* put in newline at end of line */
- ! lp++->gset = GSET_ASCII;
- ! #else /* !KTERM */
- ! *lp ++ = '\n'; /* put in newline at end of line */
- ! #endif /* !KTERM */
- ! }
- !
- ! for(i = crow +1; i < row; i++) {
- ! lp = SaveText(screen, i, 0, screen->max_col, lp);
- !
- ! /*
- ! * Only preserve tabs and newlines if the flag is set,
- ! * otherwise act in the normal fashion.
- ! */
- ! if (screen->tabnlpres != True) {
- ! #ifdef KTERM
- ! lp->code = '\n';
- ! lp++->gset = GSET_ASCII;
- ! #else /* !KTERM */
- ! *lp ++ = '\n';
- ! #endif /* !KTERM */
- ! }
- ! }
-
- if (col >= 0)
- lp = SaveText(screen, row, 0, col, lp);
- ***************
- *** 1956,1961 ****
- --- 1978,1984 ----
- #ifdef KTERM
- register Bchr *ch = screen->buf[row + screen->topline];
- register Char g;
- + register int tabnlpres = screen->tabnlpres;
- # ifdef KTERM_HANZI
- /*
- * Need to check to see if a Big5 font is in use also.
- ***************
- *** 1975,1987 ****
- * Just hoping that there will always be enough space allocated for
- * new lines.
- */
- ! if (ch[ecol].attr & NL_TAG)
- ecol++;
- for (i = scol; i < ecol; i++) {
- #ifdef KTERM
- c = ch[i].code & ~NEEDMAP;
- g = ch[i].gset;
- ! if (ch[i].attr & TAB_TAG) {
- lp->code = '\t';
- lp->gset = GSET_ASCII;
- i++;
- --- 1998,2010 ----
- * Just hoping that there will always be enough space allocated for
- * new lines.
- */
- ! if (tabnlpres != False && ch[ecol].attr & NL_TAG)
- ecol++;
- for (i = scol; i < ecol; i++) {
- #ifdef KTERM
- c = ch[i].code & ~NEEDMAP;
- g = ch[i].gset;
- ! if (tabnlpres != False && ch[i].attr & TAB_TAG) {
- lp->code = '\t';
- lp->gset = GSET_ASCII;
- i++;
- ***************
- *** 1991,1997 ****
- if (i < ecol &&
- (ch[i].code != '\0' || ch[i].attr & (TAB_TAG|NL_TAG)))
- i--;
- ! } else if (ch[i].attr & NL_TAG) {
- lp->code = '\n';
- lp->gset = GSET_ASCII;
- } else if (c < ' ' || c == 0x7f && !(g & CS96)) {
- --- 2014,2020 ----
- if (i < ecol &&
- (ch[i].code != '\0' || ch[i].attr & (TAB_TAG|NL_TAG)))
- i--;
- ! } else if (tabnlpres != False && ch[i].attr & NL_TAG) {
- lp->code = '\n';
- lp->gset = GSET_ASCII;
- } else if (c < ' ' || c == 0x7f && !(g & CS96)) {
- *** charproc.c.ORIG Mon May 13 19:43:39 1991
- --- charproc.c Mon May 13 19:58:13 1991
- ***************
- *** 119,124 ****
- --- 119,125 ----
- #define XtNlogInhibit "logInhibit"
- #define XtNloginShell "loginShell"
- #define XtNmarginBell "marginBell"
- + #define XtNtabNlPreserve "tabNlPreserve"
- #define XtNpointerColor "pointerColor"
- #define XtNpointerColorBackground "pointerColorBackground"
- #define XtNpointerShape "pointerShape"
- ***************
- *** 183,188 ****
- --- 184,190 ----
- #define XtCLogging "Logging"
- #define XtCLogInhibit "LogInhibit"
- #define XtCLoginShell "LoginShell"
- + #define XtCTabNlPreserve "TabNlPreserve"
- #define XtCMarginBell "MarginBell"
- #define XtCMultiClickTime "MultiClickTime"
- #define XtCMultiScroll "MultiScroll"
- ***************
- *** 396,401 ****
- --- 398,404 ----
- { "set-allow132", HandleAllow132 },
- { "set-cursesemul", HandleCursesEmul },
- { "set-marginbell", HandleMarginBell },
- + { "set-tabnlpres", HandleTabNlPreserve },
- { "set-altscreen", HandleAltScreen },
- { "soft-reset", HandleSoftReset },
- { "hard-reset", HandleHardReset },
- ***************
- *** 579,584 ****
- --- 582,590 ----
- {XtNmarginBell, XtCMarginBell, XtRBoolean, sizeof(Boolean),
- XtOffset(XtermWidget, screen.marginbell),
- XtRBoolean, (caddr_t) &defaultFALSE},
- + {XtNtabNlPreserve, XtCTabNlPreserve, XtRBoolean, sizeof(Boolean),
- + XtOffset(XtermWidget, screen.tabnlpres),
- + XtRBoolean, (caddr_t) &defaultFALSE},
- {XtNpointerColor, XtCForeground, XtRPixel, sizeof(Pixel),
- XtOffset(XtermWidget, screen.mousecolor),
- XtRString, "XtDefaultForeground"},
- ***************
- *** 3463,3468 ****
- --- 3469,3475 ----
- new->screen.jumpscroll = request->screen.jumpscroll;
- new->screen.logfile = request->screen.logfile;
- new->screen.marginbell = request->screen.marginbell;
- + new->screen.tabnlpres = request->screen.tabnlpres;
- new->screen.mousecolor = request->screen.mousecolor;
- new->screen.mousecolorback = request->screen.mousecolorback;
- new->screen.multiscroll = request->screen.multiscroll;
- *** main.c.ORIG Mon Mar 18 19:21:48 1991
- --- main.c Mon May 13 21:18:58 1991
- ***************
- *** 490,495 ****
- --- 490,497 ----
- {"+t", "*tekStartup", XrmoptionNoArg, (caddr_t) "off"},
- {"-tm", "*ttyModes", XrmoptionSepArg, (caddr_t) NULL},
- {"-tn", "*termName", XrmoptionSepArg, (caddr_t) NULL},
- + {"-tnp", "*tabNlPreserve", XrmoptionNoArg, (caddr_t) "on"},
- + {"+tnp", "*tabNlPreserve", XrmoptionNoArg, (caddr_t) "off"},
- {"-ut", "*utmpInhibit", XrmoptionNoArg, (caddr_t) "on"},
- {"+ut", "*utmpInhibit", XrmoptionNoArg, (caddr_t) "off"},
- {"-vb", "*visualBell", XrmoptionNoArg, (caddr_t) "on"},
- *** menu.c.ORIG Mon May 13 19:30:24 1991
- --- menu.c Mon May 13 21:18:54 1991
- ***************
- *** 30,36 ****
- do_terminate(), do_kill(), do_quit(), do_scrollbar(), do_jumpscroll(),
- do_reversevideo(), do_autowrap(), do_reversewrap(), do_autolinefeed(),
- do_appcursor(), do_appkeypad(), do_scrollkey(), do_scrollttyoutput(),
- ! do_allow132(), do_cursesemul(), do_marginbell(), do_tekshow(),
- do_altscreen(), do_softreset(), do_hardreset(), do_tekmode(), do_vthide(),
- do_tektextlarge(), do_tektext2(), do_tektext3(), do_tektextsmall(),
- do_tekpage(), do_tekreset(), do_tekcopy(), do_vtshow(), do_vtmode(),
- --- 30,37 ----
- do_terminate(), do_kill(), do_quit(), do_scrollbar(), do_jumpscroll(),
- do_reversevideo(), do_autowrap(), do_reversewrap(), do_autolinefeed(),
- do_appcursor(), do_appkeypad(), do_scrollkey(), do_scrollttyoutput(),
- ! do_allow132(), do_cursesemul(), do_marginbell(), do_tekshow(),
- ! do_tabnlpres(),
- do_altscreen(), do_softreset(), do_hardreset(), do_tekmode(), do_vthide(),
- do_tektextlarge(), do_tektext2(), do_tektext3(), do_tektextsmall(),
- do_tekpage(), do_tekreset(), do_tekcopy(), do_vtshow(), do_vtmode(),
- ***************
- *** 85,100 ****
- { "cursesemul", do_cursesemul, NULL }, /* 11 */
- { "visualbell", do_visualbell, NULL }, /* 12 */
- { "marginbell", do_marginbell, NULL }, /* 13 */
- ! { "altscreen", do_altscreen, NULL }, /* 14 */
- ! { "line1", NULL, NULL }, /* 15 */
- ! { "softreset", do_softreset, NULL }, /* 16 */
- ! { "hardreset", do_hardreset, NULL }, /* 17 */
- ! { "line2", NULL, NULL }, /* 18 */
- ! { "tekshow", do_tekshow, NULL }, /* 19 */
- ! { "tekmode", do_tekmode, NULL }, /* 20 */
- #if defined(STATUSLINE) || defined(KTERM_KANJI)
- ! { "vthide", do_vthide, NULL }, /* 21 */
- ! { "line3", NULL, NULL }, /* 22 */
- #ifdef STATUSLINE
- { "statusline", do_statusline, NULL },
- { "reversestatus", do_reversestatus, NULL },
- --- 86,102 ----
- { "cursesemul", do_cursesemul, NULL }, /* 11 */
- { "visualbell", do_visualbell, NULL }, /* 12 */
- { "marginbell", do_marginbell, NULL }, /* 13 */
- ! { "tabnlpres", do_tabnlpres, NULL }, /* 14 */
- ! { "altscreen", do_altscreen, NULL }, /* 15 */
- ! { "line1", NULL, NULL }, /* 16 */
- ! { "softreset", do_softreset, NULL }, /* 17 */
- ! { "hardreset", do_hardreset, NULL }, /* 18 */
- ! { "line2", NULL, NULL }, /* 19 */
- ! { "tekshow", do_tekshow, NULL }, /* 20 */
- ! { "tekmode", do_tekmode, NULL }, /* 21 */
- #if defined(STATUSLINE) || defined(KTERM_KANJI)
- ! { "vthide", do_vthide, NULL }, /* 22 */
- ! { "line3", NULL, NULL }, /* 23 */
- #ifdef STATUSLINE
- { "statusline", do_statusline, NULL },
- { "reversestatus", do_reversestatus, NULL },
- ***************
- *** 221,226 ****
- --- 223,229 ----
- update_visualbell();
- #endif
- update_marginbell();
- + update_tabnlpres();
- #ifdef STATUSLINE
- update_statusline();
- set_reversestatus_sensitivity();
- ***************
- *** 682,688 ****
- --- 685,700 ----
- update_marginbell();
- }
-
- + static void do_tabnlpres (gw, closure, data)
- + Widget gw;
- + caddr_t closure, data;
- + {
- + register TScreen *screen = &term->screen;
-
- + screen->tabnlpres = !screen->tabnlpres;
- + update_tabnlpres();
- + }
- +
- static void handle_tekshow (gw, allowswitch)
- Widget gw;
- Bool allowswitch;
- ***************
- *** 1347,1352 ****
- --- 1359,1374 ----
- Cardinal *param_count;
- {
- handle_toggle (do_marginbell, (int) term->screen.marginbell,
- + params, *param_count, w, NULL, NULL);
- + }
- +
- + void HandleTabNlPreserve(w, event, params, param_count)
- + Widget w;
- + XEvent *event;
- + String *params;
- + Cardinal *param_count;
- + {
- + handle_toggle (do_tabnlpres, (int) term->screen.tabnlpres,
- params, *param_count, w, NULL, NULL);
- }
-
- *** menu.h.ORIG Mon May 13 19:30:18 1991
- --- menu.h Mon May 13 20:54:21 1991
- ***************
- *** 26,32 ****
- HandleAutoWrap(), HandleReverseWrap(), HandleAutoLineFeed(),
- HandleAppCursor(), HandleAppKeypad(), HandleScrollKey(),
- HandleScrollTtyOutput(), HandleAllow132(), HandleCursesEmul(),
- ! HandleMarginBell(), HandleAltScreen(), HandleSoftReset(),
- HandleHardReset(), HandleSetTerminalType(), HandleVisibility(),
- HandleSetTekText(), HandleTekPage(), HandleTekReset(), HandleTekCopy();
- #ifdef STATUSLINE
- --- 26,32 ----
- HandleAutoWrap(), HandleReverseWrap(), HandleAutoLineFeed(),
- HandleAppCursor(), HandleAppKeypad(), HandleScrollKey(),
- HandleScrollTtyOutput(), HandleAllow132(), HandleCursesEmul(),
- ! HandleMarginBell(), HandleTabNlPreserve(), HandleAltScreen(), HandleSoftReset(),
- HandleHardReset(), HandleSetTerminalType(), HandleVisibility(),
- HandleSetTekText(), HandleTekPage(), HandleTekReset(), HandleTekCopy();
- #ifdef STATUSLINE
- ***************
- *** 78,93 ****
- #define vtMenu_cursesemul 11
- #define vtMenu_visualbell 12
- #define vtMenu_marginbell 13
- ! #define vtMenu_altscreen 14
- ! #define vtMenu_line1 15
- ! #define vtMenu_softreset 16
- ! #define vtMenu_hardreset 17
- ! #define vtMenu_line2 18
- ! #define vtMenu_tekshow 19
- ! #define vtMenu_tekmode 20
- ! #define vtMenu_vthide 21
- #if defined(STATUSLINE) || defined(KTERM_KANJI)
- ! # define vtMenu_line3 22
- #endif /* STATUSLINE || KTERM_KANJI */
- #ifdef STATUSLINE
- # define vtMenu_statusline (vtMenu_line3+1)
- --- 78,94 ----
- #define vtMenu_cursesemul 11
- #define vtMenu_visualbell 12
- #define vtMenu_marginbell 13
- ! #define vtMenu_tabnlpres 14
- ! #define vtMenu_altscreen 15
- ! #define vtMenu_line1 16
- ! #define vtMenu_softreset 17
- ! #define vtMenu_hardreset 18
- ! #define vtMenu_line2 19
- ! #define vtMenu_tekshow 20
- ! #define vtMenu_tekmode 21
- ! #define vtMenu_vthide 22
- #if defined(STATUSLINE) || defined(KTERM_KANJI)
- ! # define vtMenu_line3 23
- #endif /* STATUSLINE || KTERM_KANJI */
- #ifdef STATUSLINE
- # define vtMenu_statusline (vtMenu_line3+1)
- ***************
- *** 260,265 ****
- --- 261,271 ----
- vtMenuEntries[vtMenu_marginbell].widget, \
- term->screen.marginbell)
-
- + #define update_tabnlpres() \
- + update_menu_item (term->screen.vtMenu, \
- + vtMenuEntries[vtMenu_tabnlpres].widget, \
- + term->screen.tabnlpres)
- +
- #define update_altscreen() \
- update_menu_item (term->screen.vtMenu, \
- vtMenuEntries[vtMenu_altscreen].widget, \
- ***************
- *** 287,297 ****
- --- 293,305 ----
- update_menu_item (term->screen.vtMenu, \
- vtMenuEntries[vtMenu_statusline].widget, \
- term->screen.statusline)
- +
- #define update_reversestatus() \
- update_menu_item (term->screen.vtMenu, \
- vtMenuEntries[vtMenu_reversestatus].widget, \
- term->screen.reversestatus)
- #endif /* STATUSLINE */
- +
- #ifdef KTERM_KANJI
- #define update_eucmode() \
- update_menu_item (term->screen.vtMenu, \
- *** patchlevel.h.ORIG Wed May 15 03:55:46 1991
- --- patchlevel.h Wed May 15 03:55:48 1991
- ***************
- *** 1 ****
- ! #define patchlevel 6
- --- 1 ----
- ! #define patchlevel 7
- *** ptyx.h.ORIG Mon May 13 19:35:57 1991
- --- ptyx.h Mon May 13 19:47:56 1991
- ***************
- *** 390,395 ****
- --- 390,396 ----
- Boolean marginbell; /* true if margin bell on */
- int nmarginbell; /* columns from right margin */
- int bellarmed; /* cursor below bell margin */
- + Boolean tabnlpres; /* true if TAB/NL preserved */
- Boolean multiscroll; /* true if multi-scroll */
- int scrolls; /* outstanding scroll count */
- SavedCursor sc; /* data for restore cursor */
-
- --
- Dan Heller
- O'Reilly && Associates Z-Code Software Comp-sources-x:
- Senior Writer President comp-sources-x@uunet.uu.net
- argv@ora.com argv@zipcode.com
-